---
title: Determine maximum policy effective date
summary: Determines the latest policy-period effective date for a policy via a correlated subquery.
status: draft
owner: SAIF Claims BOF team
last_reviewed: 2026-08-21
library: SAIF.Business.Policy
reference_type: embedded
operation_id: OP-POL-002
trigger: Caller reads PolicyInformation.MaxPolicyEffectiveDate
---

# Determine maximum policy effective date

Determines the maximum (most recent) policy-period effective date for a policy by correlating each row against a self-joined subquery on `POLICY_PERIOD`.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-POL-002 |
| **Trigger** | Caller reads the shared property `PolicyInformation.MaxPolicyEffectiveDate(inDPI, inPolicyNumber)` |
| **Inputs** | Data portal info (`inDPI`), policy number (`inPolicyNumber`) |
| **Outputs** | `Date` |
| **Primary components** | `PolicyInformation.MaxPolicyEffectiveDate` |
| **Entry point** | `SAIF.Business.Policy\PolicyInformation.vb` |

## Steps

1. Caller reads the shared property `PolicyInformation.MaxPolicyEffectiveDate(inDPI, inPolicyNumber)`.
2. A new `IPortalRequest`/`IDataRequest` is built directly from `inDPI.DataAccessLayer`; `SQLStatement` is set to `SQL.PolicyEffectiveDate` ([SQL-008](../sql/SQL-008-max-policy-effective-date.md), scalar, against [POLICY_PERIOD](../database-tables.md#policy_period)).
3. Parameter `in_policy_num` is bound; `DAL.ProcessPortalRequest(PortalRequest)` executes it.
4. Result is cast to `Date` and returned.
   - On failure/no match: no error handling for `Nothing`/`DBNull` is present — would raise a cast exception.**

## Process flow

```mermaid
flowchart TD
	Start([MaxPolicyEffectiveDate read]) --> S1[Build IDataRequest with SQL-008]
	S1 --> S2[Bind in_policy_num]
	S2 --> S3[DAL.ProcessPortalRequest executes]
	S3 --> D{Result is DBNull/Nothing?}
	D -->|Yes| EndErr([Cast exception - unconfirmed behavior])
	D -->|No| EndOk([Return Date])
```

## Failure and edge-case behavior
- No null/`DBNull` guard on the cast result — behavior when no matching row exists is unconfirmed.**

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

> **Note:** Statements marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `SAIF.Business.Policy\PolicyInformation.vb`
